let chartDataString = decodeHtml(chartData);
let chartJsonArray =JSON.parse(chartDataString);

let arrayLength = chartJsonArray.length;
let numericData = [];
let labelData = [];

for (let i=0;i<arrayLength;i++){
    numericData[i]=chartJsonArray[i].value;
    labelData[i]=chartJsonArray[i].label;
}

const options={
    plugins: {
        title:{
            display:true,
            text:"项目状态"
        }
    }
}

const data = {
    labels: labelData,
    datasets: [{
        label:"my test",
        data: numericData,
        backgroundColor: [
            'rgb(255, 99, 132)',
            'rgb(54, 162, 235)',
            'rgb(255, 205, 86)'
        ],
        hoverOffset: 4
    }]
};





//饼图
new Chart(document.getElementById("myPieChart"),{
    type:'pie',
    data:data,
    options:options
})

function decodeHtml(html){
    let txt=document.createElement("textarea");
    txt.innerHTML=html;
    return txt.value;
}